<?php
  if (!defined('EXPONENT')) exit('');
    if (exponent_users_isAdmin() ||  exponent_permissions_check(array("administrate"),$loc))
    {
        if(isset($_REQUEST['mail_status']))
        {
            if($_REQUEST['mail_status']==0)
            {
                $table='mailsystem_mail';
            }
            else if($_REQUEST['mail_status']==1)
            {
                $table='mailsystem_mail_sent';
            }
            else
            {
                $table='mailsystem_mail_error';
            }
            
        }
        $template=new template("mailsystemmodule","_mails_manage_view",$loc); 
        $mail=$db->selectObject($table,'id='.intval($_REQUEST['id']));
        $mail->date_insert = date("F j, Y g:i a", $mail->date_insert);
        $mail->date_send = date("F j, Y g:i a", $mail->date_send);
        $template->assign('mail',$mail);
        $template->output();       
    }
?>

